package design.pattern.状态模式;

/**
 * 具体状态类：吃饭状态
 */
public class LunchState implements State{
    @Override
    public void handle(Context context) {
        if(context.getHour() <= 12){
            context.setState(new ForenoonState()).request();
        } else if(context.getHour() > 13){
            context.setState(new AfternoonState()).request();
        } else {
            System.out.println("现在时间:" + context.getHour() + ", 工作到中午饿死了，吃饭中～");
        }
    }
}
